Skip to content

bi7/0c: resources: a tip mounting shaft's state is the tip it carries - #1640

Open
cmoscy wants to merge 5 commits into
PyLabRobot:mainfrom
cmoscy:bi7/0c-shaft-state
Open

cmoscy wants to merge 5 commits into
PyLabRobot:mainfrom
cmoscy:bi7/0c-shaft-state

Conversation

@cmoscy

@cmoscy cmoscy commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Persist a shaft's carried tip in serialize_state / load_state, so heads that cannot sense tips keep them across save_state_to_file / load_state_from_file.

Test plan

  • TipMountingShaft state round-trip tests pass (save/load, clear, name conflicts)

… empty cache

Choosing a device by `serial_number` compared it with `dev._serial_number`, which PyUSB fills
only once something has read `dev.serial_number`. Straight after enumeration it is None, so every
device was refused as having no serial number. The serial number is now read through the
descriptor (`dev.serial_number`), and a device without one (`iSerialNumber == 0`) is still refused.
The Biomek tips (T50F, T190F, T230, T1025F, T1070), their 96-tip boxes (BC50F, BC190F, BC230,
BC1025F, BC1070), plates (Thermo96VB_PP, BCFlat96, BCDeep96Square, Thomson_24w_Square_RB, with the
lids Biomek seats on them) and reservoirs (ThermoNUNC_350CB, Reservoir, ModularReservoir),
transcribed from Biomek 5's tip and labware classes.

A tip is a `BiomekTip`, a `Tip` that also carries its cone (the radius at its end and the length
over which it widens); a well is a `BiomekWell`, a `Well` that also carries Biomek's outline of it by
height (`WellSegment`s), from which its height <-> volume table and its wall come. Biomek uses both
to place a tip near a well's wall, as `HamiltonTip` and `TecanTip` carry their instruments' data. A
tip box is a `StandingTipRack` whose tip spots sit on its top face, where the head's mandrels meet
the tips. Each resource carries Biomek's grip point (`preferred_pickup_location`). A resource
library page lists them with their part numbers.
`TipMountingShaft.serialize_state` holds the tool the shaft carries (as it serializes; None for
none), as a tip spot's state holds its tip, and `load_state` puts it back: the saved tip goes onto
the shaft (a tool of the same name held elsewhere in the tree gives way first), and a saved None
takes off the one it carries. State saved before shafts had any leaves the shaft as it is. With
it, `save_state_to_file` / `load_state_from_file` keep the tips a head carries across sessions,
which a device that cannot sense its tips needs.

Tests: a carried tip saved and read back, its own state after it; None taking a tip off; the same
tip staying; a tip of that name held elsewhere giving way.
@cmoscy cmoscy changed the title resources: a tip mounting shaft's state is the tip it carries bi7/0c: resources: a tip mounting shaft's state is the tip it carries Nov 17, 2026
@cmoscy
cmoscy force-pushed the bi7/0c-shaft-state branch from 261d486 to 86ff6e4 Compare November 17, 2026 03:48
@cmoscy
cmoscy marked this pull request as ready for review November 17, 2026 03:49
@cmoscy
cmoscy requested a review from a team as a code owner November 17, 2026 03:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant